package name.wilbur.course.db.bigone.control;

import name.wilbur.course.db.bigone.service.IRegisterService;
import name.wilbur.course.db.bigone.service.impl.RegisterService;

public class RegisterMgr extends BaseMgr {
	private static final String adminCode = "admin";
	private IRegisterService registerServ;
	
	public RegisterMgr() {
		registerServ = new RegisterService();
	}
	
	public boolean register(String name, String pass, String email, String regCode) {
		return registerServ.addUser(name, pass, email, isAdmin(regCode));
	}
	
	public boolean isAdmin(String regCode) {
		if (adminCode.equals(regCode))
			return true;
		return false;
	}
}
